import { plugin, Super, BotApi, AssociationApi } from '../../model/api/gameapi.js'
export class AssAdminWork extends plugin {
    constructor() {
        super(Super({
            rule: [
                {
                    reg: '^#宗门数据$',
                    fnc: 'assBackups'
                },
                {
                    reg: '^#宗门复原.*$',
                    fnc: 'assRecovery'
                }
            ]
        }))
    }
    assBackups = async (e) => {
        if (!e.isMaster) {
            return
        }
        await BotApi.User.forwardMsg({ e, data: AssociationApi.Schedule.viewbackups() })
        return
    }
    assRecovery = async (e) => {
        if (!e.isMaster) {
            return
        }
        await BotApi.User.forwardMsg({ e, data: AssociationApi.Schedule.backuprecovery({ name: e.msg.replace('#盒子复原', '') }) })
        return
    }
}